package edu.nf.supermarket.mapper;

import edu.nf.supermarket.entity.Address;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * @author yjj
 * @date 2025-05-19
 */
public interface AddressMapper {
    /**
     * 添加收货地址
     * @param address
     * @param userId
     */
    void addAddress(@Param("address") Address address, @Param("userId") Integer userId);
    /**
     * 修改收货地址
     * @param address
     */
    void updateAddress(@Param("address") Address address);
    /**
     * 删除收货地址
     */
    void deleteAddress(Integer addressId);
    /**
     * 查询收货地址
     */
    List<Address> findAllAddress(Integer userId);
    /**
     *设置默认地址
     */
    void defaultAddress(@Param("userId") Integer userId);
    void setDefault(@Param("userId") Integer userId, @Param("addressId") Integer addressId);
}
